home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / windows / pmcstex.zip / PM_KEYS.E (.txt) < prev    next >
LaTeX Document  |  1996-06-01  |  1KB  |  41 lines

  1. /* Some my favourite key sequences are defined here -pm- */
  2. -- CTRL/Y deletes line
  3. def C_Y = 
  4. deleteline; .col=1
  5. -- Alt-Z margins for e-mailed documents, TeX files and programs
  6. def A_Z =
  7. ma4='ma 1 1599 1'; ma3='ma 1 82 1'; ma2='ma 1 74 1'
  8. s=entrybox('Set margins','/OK/'ma2'/'ma3'/'ma4,'ma '.margins,30,30)
  9. if     s=4 then s=ma4
  10. elseif s=3 then s=ma3
  11. elseif s='' then s=ma2
  12. endif
  13. -- Alt-Q produces quickly \begin{equation} \end{equation} environment
  14. -- with two comment line above and below
  15. def A_Q = 
  16.   if .col>1 then .line=.line+1; endif
  17.   insertline '%'; insertline '\begin{equation}'
  18.   insertline ''
  19.   insertline '\end{equation}'; insertline '%'
  20.   .line=.line-3
  21.   .col=1
  22. -- The following macro redefines default Ctrl-Q of EPM
  23. -- If \begin{..} or \end{..} is the only text on the line (where 
  24. -- ..=equation,eqnarray or align), it changes the line to the next environment 
  25. -- in this list. Useful if you add one more equation into an \begin{equation}
  26. -- Note: this could be more powerful if this command would change both 
  27. -- \begin{..} and \end{..} simultaneously.
  28. def C_Q = 
  29. B='\begin{'; E='\end{'
  30. s1='equation}'; s2='eqnarray}'; s3='align}'
  31. getline S
  32. if    S=B''s1    then    S=B''s2
  33. elseif    S=B''s2    then    S=B''s3
  34. elseif    S=B''s3    then    S=B''s1
  35. elseif    S=E''s1    then    S=E''s2
  36. elseif    S=E''s2    then    S=E''s3
  37. elseif    S=E''s3    then    S=E''s1
  38. else return;
  39. endif
  40. replaceline S
  41.